<template>
  <div class="generate-container">
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span>专业课程体系生成</span>
      </div>
      <el-form :model="form" label-width="120px">
        <el-form-item label="专业名称">
          <el-input v-model="form.majorName" placeholder="请输入专业名称" />
        </el-form-item>
        <el-form-item label="课程列表">
          <el-transfer v-model="form.selectedCourses" :data="courses" :titles="['可选课程', '已选课程']" />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="generateCourseSystem">生成课程体系</el-button>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: {
        majorName: '计算机科学与技术',
        selectedCourses: []
      },
      courses: [
        { key: '1', label: '高等数学' },
        { key: '2', label: '线性代数' },
        { key: '3', label: '概率论与数理统计' },
        { key: '4', label: '离散数学' },
        { key: '5', label: '计算机导论' },
        { key: '6', label: '程序设计基础' },
        { key: '7', label: '数据结构' },
        { key: '8', label: '算法设计与分析' },
        { key: '9', label: '操作系统' },
        { key: '10', label: '计算机网络' },
        { key: '11', label: '数据库原理' },
        { key: '12', label: '软件工程' },
        { key: '13', label: '人工智能导论' },
        { key: '14', label: '机器学习' },
        { key: '15', label: '计算机图形学' },
        { key: '16', label: '编译原理' },
        { key: '17', label: '计算机组成原理' },
        { key: '18', label: '嵌入式系统' },
        { key: '19', label: '网络安全' },
        { key: '20', label: '云计算' }
      ]
    }
  },
  methods: {
    generateCourseSystem() {
      if (this.form.selectedCourses.length === 0) {
        this.$message.warning('请选择课程')
        return
      }
      this.$message.success('课程体系生成成功')
      console.log('生成的课程体系:', this.form)
    }
  }
}
</script>

<style scoped>
.generate-container {
  padding: 20px;
}

.box-card {
  max-width: 800px;
  margin: 0 auto;
}
</style>
